#include <en_us.h>
#include <adv3.h>
#include <devices.t>

gameMain: GameMainDef
  initialPlayerChar = me
  showIntro()
    {
        "You were captured by the royal soldiers at the service of the Duke, wasting no time they brought you down to the dungeon cells, no doubt in short time the Duke himself will come down here to make you pay for all your antics as a rebel princess.

The soldiers leave you with you hog tied on the dungeon floor, they take you for a helpless damsel and make no effort to bind you further and then leave not wanting to spend any extra moment in this awful place. Only a lone and bored guard stays at the door.

  ";
  //initialize things
  //hogtierope.makeWornBy(me);
  shackles.makeWornBy(me);
  yoke.makeWornBy(me);
    }
;


versionInfo: GameID
  name = 'Dungeon escape'
  byline = 'by DarknessMonger and Aurelie Catena'
  authorEmail = 'darkness.monger@gmail.com'
  desc = 'Escape from a dark damp dungeon '
  version = '1'
  IFID = 'b8563851-6257-77c3-04ee-278ceaeb48ac'
;

startcell: Room 'Cell'
  "The cell is filthy and damp. Its floor is partly covered with a layer of straw. There is a drain hole in the far corner."
  smellDesc = "There is a bad stench floating in the air, a mix of cold sweat and rotten straw..."
  north = cellDoor
  out asExit(north)
;
 
+cellDoor: LockableWithKey, Door 'cell door' 'door' "The cell door looks very rudimentary, the key hole looks wide"
    keyList = [rustynail]
    destination = dungeon
    hearDesc = 'Pressing your ear against the door, you hear someone snoring on the other side.'
    okayUnlockMsg = 'The door\'s keyhole is a cheap, simple mechanism. Using the rusty nail as a pick, you finally manage to unlock it.'
;

+Exitable -> cellDoor 'dungeon' 'dungeon'
    "Looking through the keyhole you see a dungeon."
;

+straw: BasicContainer, Surface 'heap of straw/layer of straw' 'straw'
  "Damp, filthy, rotten, stinking layer of straw.
  It is swarming with lice and has obviously been used as a mat by countless prisoners who have soiled it with their dejections."
  smellDesc = "Its stench is a dreadful mix of cold sweat, stale urine and cum."
  isPlural = true
  objInPrep = 'in'
  dobjFor(Search) asDobjFor(LookIn)
  dobjFor(LookIn)
  {
    check()
    {
      local lstparts = [defaultWristPart,defaultAnklePart];
      local lstdifficulty = [20.00,90.00];
     if(!gActor.calculateSuccess(lstparts,lstdifficulty,nil,nil))
     {
	exit;
     }
    }
  }
;

++sharpStone: Hidden, Key 'sharp stone' 'sharp stone' "A more or less sharp slab of stone taken from a crack in the drain hole wall."
  iobjFor(CutWith)
    {
        preCond = [touchObj]
        verify() {  }
    }
;

+hogtierope: HogTie 
	desc = "A rope that holds your ankles togheter and is also tied to your hands"
	keyList = [sharpStone]
	isLocked = true
	hinderFactor = 0.90
  actionFailureDesc = " <<theName>> prevents you from doing that "
  actionSuccessDesc = " despite <<theName>> {You/he} succeed{s} "
  okayUnlockMsg = 'Contorting on the damp floor, you slowly saw the sharp rock back and forth against the rope, slowly wearing it down.
    After long minutes of effort, you eventually manage to cut it. You then unwind it from your wrists and ankles, setting yourself free.'
;

+me: DetailedTorturedPerson 
    isHer = true
    pcDesc()
	{
		"You are a pretty redhair, athletic but feminine, with gorgeous breasts and an impressive curly red mane.";
		showInventory(nil);
	}
;

++shackles: AnkleShackles
  desc = "Those are some sturdy, iron shackles for the ankles. They look a bit rusty and are quite heavy."
  isLocked = true
  keyList = [rustynail]
  hinderFactor = 0.90
  okayUnlockMsg = 'You use the rusty nail to lock-pick the simple mechanism of the shackles. After a bit of fumbling, you hear a click and feel the shackles fall on the floor.'
;

++yoke: Restraint 'yoke' 'wooden yoke'
  desc = "This is a yoke."
  layer = 1
  restraintList = [defaultNeckPart, defaultWristPart]
  isLocked = true
  okayUnlockMsg = 'You manage to dislodge the peg joining both stocks together and its hinge creaks as it opens.'
  hinderFactor = 0.50
;

+drainHole: Container 'drain hole/rusty grate' 'drain hole'
  "This hole is designed to drain the prisoner dejections to sewers.
  It is too narrow to let anyone pass and moreover it is closed by a rusty grate. It stinks like hell."
  
  verbDescription(verb, part, device)
  {
	if(verb == 'LookIn')
	{
	 if(part.ofKind(defaultHeadPart))
		"Your arms being restrained, and in spite of the foul stench, you plunge your head into the drain hole,
    trying to see something. Your long hair gets soaked with all the filth that litter the walls of the hole.
    But there you see something: one of the nails that used to keep the grate bars together has got free.";
	 else
		"You manage to explore <<theName>> with your <<part.name>> even though you are restrained with <<device.theName>>.";
	}
  }
  dobjFor(Search) asDobjFor(LookIn)
  dobjFor(LookIn)
  {
    check()
    {
      
      local lstparts = [defaultWristPart,defaultHeadPart];
      local lstdifficulty = [100.00, 80.00];
     if(!gActor.calculateSuccess(lstparts,lstdifficulty,self,'LookIn'))
     {
	exit;
     }
    }
  }
  ;

++rustynail: Hidden, Key 'rusty nail' 'nail' "Rusty nail"
  dobjFor(Take)
  {
    check()
    {
      local lstparts = [defaultWristPart];
      local lstdifficulty = [100.00];
     if(!gActor.calculateSuccess(lstparts, lstdifficulty, nil, nil))
     {
        "You crawl to the drain hole and roll on your flank. Then you try to reach into the filthy hole with your
        bound hands. Unfortunately, you cannot reach far enough to grab the nail."; 
	     exit;
      }else{
        "You reach into the filthy drain hole with your hand, fumble a bit along the rusty grate and finally find the nail.";
      }  
    }
  }
;

dungeon: Room 'Dungeon'
 "Outisde the cells is a large dungeon area"
 ;
 
+ sleepingGuard: DetailedTorturedPerson 'guard/soldier' 'Guard'
  "Right next to the cell you can see the bored guard tasked with overseeing the prison area.
  He just ate his lunch and is resting with his back against the wall, producing a very loud snore."
	isHim = true
;

+ cellDoorout: Lockable, Door -> cellDoor 'cell door*doors' 'cell door'
 ;
 
 +dungeonDoor: LockableWithKey, Door  'dungeon  door*doors' 'dungeon door' "At the end of the dungeon area is a heavy door, it's lock seems a lot more elaborate than the one on the cells"
 ;
